<?php
/**
 * Basic queue which implements a first on first off data structure
 * 
 * @package junction.utils
 * @author Alexander Schearer <aas11@duke.edu>
 */
class Junction_Utils_Queue {
	
	/**
	 * Data array
	 *
	 * @var array
	 */
	private $_data;
	
	public function __construct() {
		$this->_data = array();
	}
	
	/**
	 * Add a new element to the end of the queue
	 *
	 * @param unknown_type $value
	 */
	public function add($value) {
		$this->_data[] = $value;
	}
	
	/**
	 * Retrieve the first element off the front of the queue
	 *
	 * @return unknown_type
	 */
	public function remove() {
		return array_shift($this->_data);
	}
	
	/**
	 * Return how many elements are in the queue
	 *
	 * @return int
	 */
	public function size() {
		return count($this->_data);
	}
}
?>